.org 0xE6AE4 ; Stealth Firepower

Stealth_Firepower:

	PUSH 	{R4, LR}
	
	CMP 	R1, 0
	MOV 	R4, 0
	BEQ 	Unit_Not_In_Stealth
	
	LDR 	R2, [Stealth_Firepower_1]
	LDR 	R1, [Stealth_Firepower_2]
	LDR 	R2, [R2, 0]
	LDR 	R1, [R1, 0]
	MOV 	R3, 0x98
	ADD 	R1, R2, R1, LSL 2
	LDR 	R2, [R1, 0x48]
	
	MOV 	R1, Rank_Backstab					; Rank: Backstab

	ADD 	R2, R2, 0x5000
	LDR 	R2, [R2, 0xA58]
	MLA 	R2, R0, R3, R2
	ADD 	R0, R2, 0x74
	BL 		Check_Skills_Equipped				; Check the Skill is equipped
	
	CMP 	R0, 0								; Does CO use that skill?
	ADDNE 	R4, R4, 15							; If CO use skill, add +15 firepower
	
;-------------------------------------------------------------------------------

Unit_Not_In_Stealth:

	MOV 	R0, R4
	POP 	{R4, LR}
	
	BX 		LR

;-------------------------------------------------------------------------------		

Stealth_Firepower_1:
	.dw Reg1_Skill
	
Stealth_Firepower_2:
	.dw Reg2_Skill



